package JVM相关知识;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author coderFu
 * @create 2022/1/3
 * java 的语法糖
 *  自动装箱 自动拆箱
 *  循环遍历
 */
public class TestGrammarSweet {

    public static void main(String[] args) {
        List<Integer> list = new ArrayList<Integer>(){{
            add(1);
            add(2);
        }};
        ArrayList<Integer> integers = new ArrayList<>(Arrays.asList(1, 2, 3, 4, 5, 6));
        System.out.println(integers.get(1));
        int a = integers.get(2);
        System.out.println(a);
        System.out.println(list);

        for (Integer integer : integers) {
            System.out.println(integer);
        }
    }
}
